package com.jzbwlkj.windowmanager;

import android.util.Log;

import java.util.Random;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by chenx on 2017/11/7.
 */

public class 测试线程池
{
    ExecutorService cachedThreadPool = Executors.newCachedThreadPool();
    ExecutorService cachedThreadPool2 = Executors.newFixedThreadPool(5);

    public 测试线程池() throws InterruptedException
    {
        while (true)
        {
            cachedThreadPool.execute(new Runnable()
            {
                @Override
                public void run()
                {
                    try
                    {
                        Log.e("BBBB", String.valueOf(new Random().nextInt(100)));
                        Thread.sleep(2000);
                    } catch (InterruptedException e)
                    {
                        e.printStackTrace();
                    }

                }
            });
            Thread.sleep(2000);
        }

    }
}
